
package com.insigma.business.qrcode.common.converter;



import com.insigma.business.qrcode.soldier.dto.PlacementSoldierAspirationResultBSearcher;
import com.insigma.business.qrcode.soldier.dto.PlacementSoldierAspirationResultDTO;
import com.insigma.business.qrcode.soldier.entity.PlacementSoldierAspirationResultDO;
import com.insigma.business.qrcode.soldier.request.PlacementSoldierAspirationResultInsertRequest;
import com.insigma.business.qrcode.soldier.request.PlacementSoldierAspirationResultSearchRequest;
import com.insigma.business.qrcode.soldier.request.PlacementSoldierAspirationResultUpdateRequest;
import org.springframework.beans.BeanUtils;

import java.util.List;


public class PlacementSoldierAspirationResultProviderConverter extends AbstractConverter<PlacementSoldierAspirationResultDTO, PlacementSoldierAspirationResultDO> {

    private final static PlacementSoldierAspirationResultProviderConverter placementSoldierAspirationResultConverter = new PlacementSoldierAspirationResultProviderConverter();

    private PlacementSoldierAspirationResultProviderConverter(){}

    
    public static PlacementSoldierAspirationResultBSearcher convertRequestSO2Searcher(final PlacementSoldierAspirationResultSearchRequest request){
        final PlacementSoldierAspirationResultBSearcher placementSoldierAspirationResultBSearcher = new PlacementSoldierAspirationResultBSearcher(request.getPageNo(),
        request.getPageSize(),request.getSortKeyValueJoint());
        BeanUtils.copyProperties(request,placementSoldierAspirationResultBSearcher);
        return placementSoldierAspirationResultBSearcher;
    }

    
    public static PlacementSoldierAspirationResultDO convertRequestUO2DO(final PlacementSoldierAspirationResultUpdateRequest placementSoldierAspirationResultUpdateRequest) {
        final PlacementSoldierAspirationResultDO placementSoldierAspirationResultDO = new PlacementSoldierAspirationResultDO();
        BeanUtils.copyProperties(placementSoldierAspirationResultUpdateRequest,placementSoldierAspirationResultDO);
        
        return placementSoldierAspirationResultDO;
    }

    
    public static PlacementSoldierAspirationResultDO convertRequestIO2DO(final PlacementSoldierAspirationResultInsertRequest placementSoldierAspirationResultInsertRequest) {
        final PlacementSoldierAspirationResultDO placementSoldierAspirationResultDO = new PlacementSoldierAspirationResultDO();
        BeanUtils.copyProperties(placementSoldierAspirationResultInsertRequest,placementSoldierAspirationResultDO);
        return placementSoldierAspirationResultDO;
    }

    
    public static List<PlacementSoldierAspirationResultDTO> convertResponseDOList2DTOList(final List<PlacementSoldierAspirationResultDO> placementSoldierAspirationResultDOList){
        return placementSoldierAspirationResultConverter.convertGenericResponseDOList2DTOList(placementSoldierAspirationResultDOList);
    }

    
    public static PlacementSoldierAspirationResultDTO convertResponseDO2DTO(final PlacementSoldierAspirationResultDO placementSoldierAspirationResultDO){
        return placementSoldierAspirationResultConverter.convertGenericResponseDO2DTO(placementSoldierAspirationResultDO);
    }

    
    @Override
    protected PlacementSoldierAspirationResultDTO doConvertResponseDO2DTO(PlacementSoldierAspirationResultDO placementSoldierAspirationResultDO) {
        final PlacementSoldierAspirationResultDTO placementSoldierAspirationResultDTO = new PlacementSoldierAspirationResultDTO();
        try {
            BeanUtils.copyProperties(placementSoldierAspirationResultDO, placementSoldierAspirationResultDTO);
        }catch(RuntimeException be){
            
            return null;
        }
        return placementSoldierAspirationResultDTO;
    }

}
